package com.xuz.proxy.example01;

/**
 * 静态代理对象
 * @user 65453
 * @date 2024/10/9 21:21
 */
public class UserDaoProxy implements IUserDao {

    private IUserDao target;

    public UserDaoProxy(IUserDao target) {
        this.target = target;
    }

    @Override
    public void save() {
        System.out.println("开启事务"); //扩展额外功能
        target.save();
        System.out.println("提交事务");
    }
}
